<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="../css/timecheck.css" />
		<link rel="stylesheet" href="../fonts/iconfont.css" />
		<script>
      var width =window.localStorage.getItem('width');
      document.documentElement.style.fontSize =  width ? width/6.4+  'px' :'55px';
		</script>
		<style>
			html,
			body,
			#app {
				width: 100%;
				height: 100%;
				margin-bottom: 0.3rem;
			}
			
			.total-info {
				margin-top: 0.04rem;
				background-color: #FFFFFF;
				text-align: center;
				font-size: 0.22rem;
				line-height: 0.45rem;
			}
			
			table {
				font-size: 0.2rem;
				width: 100%;
				text-align: center;
				margin-top: 0.1rem;
			}
			
			table tr td{
				padding: 0.1rem 0;
				height: 0.8rem;
			}
			table,
			table,
			tbody,td div{
				text-align: center;
			}
			td span{
				display: inline-block;
				text-align: left;
				vertical-align: middle;
			}
			.bglight {
				background-color: #FFFFFF;
			}
			
			.tab-head {
				background-color: #FFFFFF;
				line-height: 0.5rem;
			}
			
			.light {
				color: #8e8a8a;
			}
			.form{
				width: 100%;
				background-color: white;
				margin-top: 0.2rem;
				padding: 0.15rem 0 ;
				display: flex;
				justify-content: space-around;
				text-align: center;
			}
			.form p{
				color:black;
				margin: 0;
			}
			.giftMachine{
				width: 48%;
			}
			.integralExchange{
				width: 48%;
			}
			.giftMachine,.integralExchange{
				background-color: rgba(204, 204, 204, 0.36);
				padding: 0.2rem 0.2rem 0.2rem;
				border-radius: 0.2rem;
			}
			.giftMachine>div{
				float: left;
				width: 50%;
				/*padding: 0 0 0.05rem;*/
				margin-top: 0.1rem;
			}
			.giftMachine>div p,.integralExchange>div p{
				margin-bottom: 0.1rem;
			}
			.borderRight1{
				border-right: 1px solid rgba(0, 0, 0, 0.51);
			}
			.integralExchange>div{
				margin-top: 0.2rem;
			}
			.fixed{
				width: 100%;
				font-size: 0.2rem;
				background-color: white;
				border-top:1px solid #ccc ;
				border-bottom:1px solid #ccc ;
				position: fixed;
				top:1.15rem;
				z-index: 9999999;
			}
			.fixed span{
				display: inline-block;
				text-align: center;
				height: 0.6rem;
				line-height: 0.6rem;
			}
			.display{
				display: none;
			}
			.fontSizeBig{
				font-size: 0.26rem;
			}
			.fontSizeSmall{
				font-size: 0.22rem;
			}
			.choose{
				width: 1rem;
				margin: 0;
				text-align: center;
				padding: 0.02rem ;
				font-size: 0.18rem;
				background-color: white;
				border: 1px solid #ED7D31;
			}
			.chooseList{
				text-align: center;
				background-color: white;
				border-left: 1px solid #ED7D31;
				border-right: 1px solid #ED7D31;

			}
			.chooseList p{
				width:100%;
				margin: 0;
				padding: 0.02rem;
				border-bottom: 1px solid #ED7D31;
				font-size: 0.18rem;
				color:black;
			}
			.chooseList  .default{
				color:white;
				background-color: #ED7D31 ;
			}
			.item{
				width: 50%;
				text-align: center;
				border: 1px solid #ccc;
			 	margin: 0;
			  padding: 0.05rem 0.1rem;
				color:black;
				background-color: #ccc;
				font-size: 0.2rem;
			}
			.flex .default2{
				background-color: white;
			}
			.dotDiv {
				width: 0.6rem;
				position: absolute;
				top: -0.02rem;
				right: 0;
			}

			.dotDiv .dot {
				width: 4px;
				height: 4px;
				border-radius: 2px;
				background-color: #ccc;
				margin: 0.05rem auto 0;
				/*float: right;*/
				/*margin-right: 0.05rem ;*/
			}
		</style>
	</head>

	<body>
		<script src="../js/echarts.common.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/vue.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="../config.js" type="text/javascript" charset="utf-8"></script>
		<script src="../common/timeCheck.js" type="text/javascript" charset="utf-8"></script>
		<script src="../js/mui.min.js"></script>
		<div id="app" class="mui-content">
			<!--(totalData.storeAmount/100).toFixed(2)-->
			<time-check :type="2" :names='names' :leftdata="(totalData.storeAmount/100).toFixed(2)" :rightdata="(totalData.storeGiftCose/100).toFixed(2)" :actnum="actnum" :fromdate="fromDate" :todate='toDate' :top="top"></time-check>
			<div class="total-info flex" style="font-size: 0.22rem">
				<div class="flex-item textLeft">毛利：{{totalData.storeGrossProfit?((totalData.storeGrossProfit)/100).toFixed(2):'--'}}</div>
				<div class="flex-item textRight">毛利率：{{totalData.storeAmount !== 0 ?  (totalData.storeGrossProfit/totalData.storeAmount*100).toFixed(2)+'%' : '--'}}</div>
				<!--<div class="flex-item">毛利：&#45;&#45;</div>-->
			</div>
			<!--数据表格 start -->
			<div class="form">
				<div class="giftMachine " >
					<p class="fontSizeBig"> <strong>礼品机</strong></p>
					<p class="fontSizeSmall" style="margin-top: 0.1rem">返奖率：{{totalData.storeAwardRate}}</p>
					<div class="borderRight1">
						<p class="fontSizeSmall" style="color:#8e8a8a">收币价值</p>
						<p style="font-size: 0.24rem">{{totalData.storeGetCoin  !==null ? (totalData.storeGetCoin/100).toFixed(2) : '--'}}</p>
					</div>
					<div >
						<!--<p class="fontSizeSmall" style="color:#8e8a8a">返奖成本</p>-->
						<!--<p>{{totalData.storeAward !==null ? (totalData.storeAward/100).toFixed(2):'&#45;&#45;'}}</p>-->
						<p class="fontSizeSmall" style="color:#8e8a8a">出奖成本</p>
						<p style="font-size: 0.24rem">{{totalData.storeAward !==null ? (totalData.storeAward/100).toFixed(2):'--'}}</p>
					</div>
					<!--<div>-->
						<!--<p style="color:#8e8a8a">返奖率</p>-->
						<!--<p>{{totalData.storeAwardRate  !==null ? totalData.storeAwardRate :'&#45;&#45;'}}</p>-->
					<!--</div>-->
				</div>
				<div class="integralExchange" style="position: relative">
					<p  class="fontSizeBig"><strong>积分兑换</strong></p>
					<p class="fontSizeSmall" style="margin-top: 0.1rem">参与人数：{{totalData.joinPeople}}</p>
					<div class="dotDiv" @click="toPage('rewardIntegralExchange')">
						<p class="dot"></p>
						<p class="dot"></p>
						<p class="dot"></p>
					</div>
					<div class="flex" style="margin-top: 0.1rem">
						<div class="flex-item" style="border-right: 1px solid black">
							<p class="fontSizeSmall" style="color:#8e8a8a">消耗积分</p>
							<p style="font-size: 0.24rem">{{totalData.conScore}}</p>
						</div>
						<div class="flex-item">
							<p class="fontSizeSmall" style="color:#8e8a8a">兑换成本</p>
							<p style="font-size: 0.24rem">{{ (totalData.changeIntegral/100).toFixed(2)}}</p>
						</div>
					</div>
					<!--<div>-->
							<!--<p style="color:#8e8a8a">成本</p>-->
							<!--<p>{{totalData.changeIntegral  !==null ? (totalData.changeIntegral/100).toFixed(2) :'&#45;&#45;'}}</p>-->
					<!--</div>-->
				</div>
			</div>
			<!--数据表格 end -->

			<div id="pieChart" style="width: 100%;height: 3.6rem;background-color: white;margin-top: 0.2rem	"></div>

			<!--设备列表 start-->
			<div class="division flex" style="position: relative">
				<div class="line"><span></span></div>
				<div class="division-word">
					设备返奖报告
				</div>
				<div class="line" style="text-align: left;width:0.3rem;"><span style="width:0.7rem;"></span></div>
				<div style="position: absolute;top:0;right:0.1rem">
					<div @click="openModal" class="choose">{{chooseValue}}</div>
					<div class="chooseList" v-show="modalShow">
						<p v-for="item in sortList "  @click="choose(item.id)" :class=" sortType === item.id ? 'default' : '' "  >{{item.value}}</p>
					</div>
				</div>
			</div>
			<!--选择成本核算 局数核算-->
			<!--<div class="flex" style="width: 100%;	padding: 0 10% 0.2rem;">-->
				<!--<p class="item " :class="{ default2 : chooseType ===1}" @click="chooseTypeFun(1)" >按出奖成本核算</p>-->
				<!--<p class="item"  :class="{ default2 : chooseType ===2}" @click="chooseTypeFun(2)" >按垫币量核算</p>-->
			<!--</div>-->
			<div :class="isFixed ===true ? 'fixed' : 'display' " style="z-index: 999999">
				<span style="width:26%">设备</span>
				<span style="width:11.5%" class="light">数量</span>

				<span v-show="chooseType ===1" style="width:15%" class="light">收币价值</span>
				<span v-show="chooseType ===1" style="width:13%" class="light">返奖成本</span>
				<span v-show="chooseType ===1" style="width:13%">返奖率</span>
				<span v-show="chooseType ===1" style="width:13%">返奖单价</span>

				<span v-show="chooseType ===2" style="width:15%" class="light">出奖数</span>
				<span v-show="chooseType ===2" style="width:13%" class="light">垫币量</span>
				<span v-show="chooseType ===2" style="width:13%">局数比</span>
				<span v-show="chooseType ===2" style="width:13%">出奖率</span>
			</div>
			<table style="margin-bottom: 0.5rem">
				<tr class="tab-head">
					<td style="width:26%">设备</td>
					<td style="width:16%" class="light">数量</td>
					<td v-show="chooseType ===1" style="width:15%" class="light">收币价值</td>
					<td v-show="chooseType ===1" style="width:15%" class="light">返奖成本</td>
					<td v-show="chooseType ===1" style="width:13%">返奖率</td>
					<td v-show="chooseType ===1" style="width:15%">返奖单价</td>

					<td v-show="chooseType ===2" style="width:15%" class="light">出奖数</td>
					<td v-show="chooseType ===2" style="width:15%" class="light">垫币量</td>
					<td v-show="chooseType ===2" style="width:13%">局数比</td>
					<td v-show="chooseType ===2" style="width:15%">出奖率</td>
				</tr>
				<tr  v-show="totalData.report.length > 0" v-for="(item,index) in deviceList" :key="index" :class="{bglight:index%2===1}" @click="toMachine(index)">
					<td style="width:26%"><div>
						<img  style="width: 0.25rem;position:relative;top:0.06rem;float: left;margin-left: 0.2rem" src="../images/liping.png" alt="">
						<span>{{item.deviceName}}</span>
					</div></td>
					<td style="width:16%" class="light">
            <div style="overflow: hidden;position: relative;width: 100%;">
              <span>{{item.deviceNumber ? item.deviceNumber+'台' : 0 }}</span>
              <img v-show="item.deviceState ===1&&dateType===0" src="../images/troubleflag-green.png" alt="" style="width: 0.2rem;vertical-align: middle;position: absolute;top:0.1rem;right: 0.05rem;"/>
              <img v-show="item.deviceState ===2&&dateType===0" src="../images/troubleflag-red.png" alt="" style="width: 0.2rem;vertical-align: middle;position: absolute;top:0.1rem;right: 0.05rem;"/>
              <img v-show="item.deviceState ===3&&dateType===0" src="../images/troubleflag-gray.png" alt="" style="width: 0.2rem;vertical-align: middle;position: absolute;top:0.1rem;right: 0.05rem;"/>
              <img v-show="item.deviceState ===4&&dateType===0" src="../images/troubleflag-gray2.png" alt="" style="width: 0.2rem;vertical-align: middle;position: absolute;top:0.1rem;right: 0.05rem;"/>
            </div>
          </td>

					<td v-show="chooseType ===1" style="width:15%" class="light"><div><span>{{item.deviceGetCoin !==null ? (item.deviceGetCoin/100).toFixed(2) : '--'}}</span></div></td>
					<td v-show="chooseType ===1" style="width:15%" class="light"><div><span>{{item.deviceAward !==null ? (item.deviceAward/100).toFixed(2) : '--'}}</span></div></td>
					<td v-show="chooseType ===1" style="width:13%"><div><span>{{item.deviceAwardRate !==null ? item.deviceAwardRate:'--'}}</span></div></td>
					<td v-show="chooseType ===1" style="width:15%"><div><span>{{item.giftPrice !==null ? ((item.giftPrice)/100).toFixed(2) : '--'}}</span></div></td>

					<td v-show="chooseType ===2" style="width:15%" class="light"><div><span>{{item.deviceAwardBureau !==null ? item.deviceAwardBureau : '--'}}</span></div></td>
					<td v-show="chooseType ===2" style="width:15%" class="light"><div><span>{{item.deiveCoins !==null ? item.deiveCoins : '--'}}</span></div></td>
					<td v-show="chooseType ===2" style="width:13%"><div><span>{{item.gameNum !=='--' ? (item.gameNum +'%') :'--'}}</span></div></td>
					<td v-show="chooseType ===2" style="width:15%"><div><span>{{item.gameRate !=='--' ? item.gameRate + '币/奖' : '--'}}</span></div></td>

				</tr>
			</table>
			<p v-show="totalData.report.length === 0" style="width: 100%;text-align: center;height: 0.2rem;line-height: 0.2rem;margin-bottom: 0.3rem">
				暂无数据
			</p>
			<p style="width: 100%;margin:0 0 0.59rem ; text-align: left;color:white;background-color:#ED7D31;padding-left: 0.1rem;font-size: 0.22rem" > 数据来源：门店抄表({{totalData.fromDate}}-{{totalData.toDate}})</p>
			<div class="bar">
				<p class="borderRight " @click="toPage2('incomeItem')">收入</p>
				<p class="borderRight " @click="toPage2('coinShopOperated')">收币</p>
				<p class="borderRight default">返奖</p>
				<p @click="toPage2('lotteryStore')">出票</p>
				<p @click="toPage2('rankingList')">榜单</p>
				<p @click="toPage2('activity')">活动</p>
			</div>
				<!--设备列表 end-->
		</div>
		<script type="text/javascript">
      mui.init();
      var vm = new Vue({
				el: '#app',
				data: function() {
					return {
						names: { 
							leftName: '总销售额',
							rightName: '总成本'
						},
						fromDate: '',
						toDate: '',
						storeId: '',
						storeName: '',
						actnum:0,
						totalData: {
							storeId: '',
							storeName: '',
							income: 0,
							prize: 0,
              report: []
						},
            pieOptions:{
                title : {
                  subtext: '礼品成本构成',
                  x:'center'
                },
                tooltip: {
                  trigger: 'item',
                  formatter: "{b} : {c} ({d}%)",
                  triggeron: 'click',
                  position: [10, 10],
                  textStyle: {
                    fontSize: 12
                  }
                },
                legend: {
                  bottom: 10,
                  left: 'center',
                  data: ['返奖', '兑换'],
                  itemGap: 5,
                  itemWidth: 10,
                  itemHeight: 10,
                  textStyle: {
                    fontSize: 10
                  }
                },
                color: ['#4472C4', '#ED7D31'],
                series: [{
                  type: 'pie',
                  selectedOffset: 5,
                  radius: '65%',
                  center: ['50%', '50%'],
                  selectedMode: 'single',
                  data: [
                    {
                      value: 0,
                      name: '返奖',
                    },
                    {
                      value: 0,
                      name: '兑换'
                    },
                  ],
                  itemStyle: {
                    normal: {
                      label: {
                        show: false
                      }
                    },
                    emphasis: {
                      shadowBlur: 10,
                      shadowOffsetX: 0,
                      shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                  }
                }]
              },
            dateType:1,
            isFixed:false,
            lastPage:'',
						top:'1rem',
//排序
            modalShow:false,
            sortList:[
              {id:0,value:'按名称'},
              {id:1,value:'按数量'},
              {id:2,value:'按收币价值'},
              {id:3,value:'按返奖成本'},
              {id:4,value:'按返奖率'},
              {id:5,value:'按返奖单价'},
            ],
            sortType:0,
            chooseValue:'按名称',
            int:0,    //0 点击第一次 张开  1 关闭
            deviceList:[],
//选择成本
            chooseType:1,
					}
				},
				created: function() {
          var vm = this
          mui.plusReady(function() {
            vm.receiveParams()
          });
				},
				mounted:function(){
          window.addEventListener('scroll', this.handleScroll)
				},
				methods: {
					receiveParams: function() {
						var sf = plus.webview.currentWebview()
						this.toDate = sf.toDate
						this.storeId = sf.storeId
						this.storeName = sf.storeName
						this.fromDate = sf.fromDate
						this.actnum = sf.actnum
            this.dateType=sf.dateType
            this.lastPage=sf.lastPage ? sf.lastPage :false

            if(this.lastPage){
              this.closePage()
            }
					},
					loadData: function() {
						var vm = this;
//						var data={
//              fromDate: new Date(vm.fromDate).format('yyyyMMdd'),
//              toDate: new Date(vm.toDate).format('yyyyMMdd'),
//              type:this.dateType,
//              storeId: vm.storeId,
//              storeName: vm.storeName,
//              checkType:2,  //2  出奖
//						}
//						console.log(JSON.stringify(data))
						console.log('/outPrize/checkByStore')
						config.ajax({
							url: '/outPrize/checkByStore',
							data: {
								fromDate: new Date(vm.fromDate).format('yyyyMMdd'),
								toDate: new Date(vm.toDate).format('yyyyMMdd'),
								type:this.dateType,
								storeId: vm.storeId,
								storeName: vm.storeName,
                checkType:2,  //2  出奖
							},
							success: function(res) {
							  console.log('列表数据：'+JSON.stringify(res))
								if(res.result === 1){
									vm.totalData = res.data;
									vm.deviceList=JSON.parse(JSON.stringify(res.data.report))
									vm.pieOptions.series[0].data=[
                    {
                      value: (vm.totalData.storeAward/100).toFixed(2),
                      name: '返奖'
                    },
                    {
                      value: (vm.totalData.changeIntegral/100).toFixed(2),
                      name: '兑换'
                    },
									];
                  vm.changeSortList()
                  if(vm.deviceList.length !==0){
                    vm.sortFun();
                  }
                  vm.initCharts()
								} else{
									mui.toast(res.errormsg)
								}

							}
						})
					},
					toMachine: function(index) {
						var vm = this
						mui.openWindow({
							url: 'rewardDeviceList.html',
							id: 'rewardDeviceList',
							styles: {
								titleNView: {
									titleText: vm.fromDate +'至' + vm.toDate,
									titleColor: "#FFFFFF",
									titleSize: "14px",
									backgroundColor: "#FF6800",
									autoBackButton: true,
									buttons: [{
										fontWeight: 'normal',
										fontSize: '18px',
										float: 'right',
										fontSrc: "_www/fonts/iconfont.ttf", //wap2app内置字体文件
										text: "\ue602",
										onclick: function() {
											var allPage = plus.webview.all()
											var nowPage = plus.webview.getWebviewById('index')
											for(var i = 0; i < allPage.length; i++) {
												if(allPage[i].getURL() !== nowPage.getURL()) {
													plus.webview.close(allPage[i]);
												}
											}
										}
									}],
									splitLine: {
										color: "#CCCCCC",
										height: "1px"
									}
								}
							},
							extras: {
								deviceId: vm.deviceList[index].deviceId,
                deviceName:vm.deviceList[index].deviceName,
								fromDate: vm.fromDate,
								toDate: vm.toDate,
								storeName:vm.storeName,
								storeId : vm.storeId,
                dateType:vm.dateType,
                deviceNum:vm.deviceList[index].deviceNumber,
                deviceNo:vm.deviceList[index].deviceNo,
							}
						});
					},
          initCharts: function() {
            var vm = this;
            var pieChart = echarts.init(document.getElementById('pieChart'));
            pieChart.setOption(vm.pieOptions)
          },
          handleScroll:function(){
            var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
            if(scrollTop > 545 ){
              vm.isFixed=true;
              vm.top='1.75rem'
            }else {
              vm.isFixed=false;
              vm.top='1.18rem'
            };
          },
          toPage2:function(url){
            var vm = this;
            var storeName=vm.storeName;
            mui.openWindow({
              url: './'+url+'.html',
              id: url,
              styles: {
                titleNView: {
                  titleText:  storeName ,
                  titleColor: "#FFFFFF",
                  titleSize: "17px",
                  backgroundColor: "#FF6800",
                  autoBackButton: true,
                  buttons: [{
                    fontWeight: 'normal',
                    fontSize: '17px',
                    float: 'right',
                    fontSrc: "_www/fonts/iconfont.ttf", //wap2app内置字体文件
                    text: "\ue602",
                    onclick: function() {
                      var allPage = plus.webview.all()
                      var nowPage = plus.webview.getWebviewById('index')
                      for(var i = 0; i < allPage.length; i++) {
                        if(allPage[i].getURL() !== nowPage.getURL()) {
                          plus.webview.close(allPage[i]);
                        }
                      }
                    }
                  }],
                  splitLine: {
                    color: "#CCCCCC",
                    height: "1px"
                  }
                }
              },
              extras: {
                storeId: vm.storeId,
                storeName: vm.storeName,
                fromDate: vm.fromDate,
                toDate:vm.toDate,
                dateType:vm.dateType,
                actnum: vm.actnum,
                lastPage: 'rewordShopReport',
              },
              createNew:true,
            });
          },
          closePage:function(){
            var vm=this;
            var allPage = plus.webview.all()
            var nowPage = plus.webview.getWebviewById(vm.lastPage)
            for(var i = 0; i < allPage.length; i++) {
              if(allPage[i].getURL() === nowPage.getURL()) {
                plus.webview.hide(allPage[i]);
                plus.webview.close(allPage[i]);
              }
            }
          },
          openModal:function(){
            if(vm.int === 0){
              this.modalShow=true;
              vm.int =1
            }else if(vm.int ===1){
              this.modalShow=false;
              vm.int =0
            }
          },
          //选择排序type
          choose:function(id){
            vm.sortType =id;
            if(vm.chooseType===2){
              if(id>1){
                id=id-4;
							}
						}
            vm.chooseValue = vm.sortList[id].value;
            vm.modalShow=false;
            vm.int=0;
            vm.sortFun();
          },
					//排序fun
          sortFun:function(){
            if(vm.sortType === 0){
              vm.deviceList = vm.deviceList.sort(function compareFunction(item1, item2) {
                return (item1.deviceNo).localeCompare(item2.deviceNo);
              });
            }else if(vm.sortType === 1){
              vm.deviceList.sort(function(a,b){
                return b.deviceNumber - a.deviceNumber
              })
            }else if(vm.sortType === 2){
              vm.deviceList.sort(function(a,b){
                return b.deviceGetCoin - a.deviceGetCoin
              })
            }else if(vm.sortType === 3){
              vm.deviceList.sort(function(a,b){
                return b.deviceAward - a.deviceAward
              })
            }else if(vm.sortType === 4){
              vm.deviceList.sort(function(a,b){
                var A= JSON.parse(JSON.stringify(a.deviceAwardRate))
                var B= JSON.parse(JSON.stringify(b.deviceAwardRate))
								A=A === '--' ? -1 : A === null ? 0 : A.replace('%','')
								B=B === '--' ? -1 : B === null ? 0 : B.replace('%','')
                return  Number(B)  - Number(A)
              })
            }else if(vm.sortType === 5){
              vm.deviceList.sort(function(a,b){
                return b.giftPrice - a.giftPrice
              })
						}else if(vm.sortType === 6){
              vm.deviceList.sort(function(a,b){
                return b.deviceAwardBureau - a.deviceAwardBureau
              })
            }else if(vm.sortType === 7){
              vm.deviceList.sort(function(a,b){
                return b.deiveCoins - a.deiveCoins
              })
            }else if(vm.sortType === 8){
              vm.deviceList.sort(function(a,b){
                return b.gameNum - a.gameNum
              })
            }else if(vm.sortType === 9){
              vm.deviceList.sort(function(a,b){
                return b.gameRate - a.gameRate
              })
            }
          },
//				选择成本  还是出奖局数
          chooseTypeFun:function(params){
            var vm=this;
            if(vm.chooseType !== params){
              vm.chooseType=params;
              //初始化排序
              vm.chooseValue = vm.sortList[0].value;
              vm.modalShow=false;
              vm.sortType=0;
              vm.sortFun();
              vm.changeSortList()
					}

			},
//根据chooseType  修改 排序列表
					changeSortList:function(){
            if(vm.chooseType ===1){
              vm.sortList=[
                {id:0,value:'按名称'},
                {id:1,value:'按数量'},
                {id:2,value:'按收币价值'},
                {id:3,value:'按返奖成本'},
                {id:4,value:'按返奖率'},
                {id:5,value:'按返奖单价'},
              ]
            }else{
              vm.sortList=[
                {id:0,value:'按名称'},
                {id:1,value:'按数量'},
                {id:6,value:'按出奖局数'},
                {id:7,value:'按收币量'},
                {id:8,value:'按局数比'},
                {id:9,value:'按出奖率'},
              ]
            }
					},
          toPage:function(url){
            var vm = this;
            var storeName=vm.storeName;
            mui.openWindow({
              url: './'+url+'.html',
              id: url,
              styles: {
                titleNView: {
                  titleText:  storeName,
                  titleColor: "#FFFFFF",
                  titleSize: "17px",
                  backgroundColor: "#FF6800",
                  autoBackButton: true,
                  splitLine: {
                    color: "#CCCCCC",
                    height: "1px"
                  }
                }
              },
              extras: {
                storeId: vm.storeId,
                storeName: vm.storeName,
                fromDate: vm.fromDate,
                toDate:vm.toDate,
                dateType:vm.dateType,
                actnum: vm.actnum,
                lastPage: 'incomeItem',
              },
              createNew:true,
            });
          },
				},
				watch: {
					fromDate: function() {
						this.loadData()
					}
				}
			})
		</script>
	</body>

</html>